home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Select (Limited Edition)
/
Computer Select.iso
/
pcc
/
v05n02
/
batspt.bas
< prev
next >
Wrap
BASIC Source File
|
1991-10-27
|
901b
|
38 lines
REM Batsplit.bas
REM Next 2 lines should be adjusted for a given system.
INFILE$ = "C:\BATFILES"
OUTDIR$ = "D:\BATCH\"
TRUE = -1
FALSE = 0
OUTFLAG% = FALSE
WRITEFLAG% = FALSE
OUTCOUNT% = 0
OPEN INFILE$ FOR INPUT AS #1
DO
LINE INPUT #1, L$
IF LEFT$(UCASE$(L$), 6) = "START " THEN
IF OUTFLAG% THEN
CLOSE #2
END IF
OUTFLAG% = TRUE
WRITEFLAG% = FALSE
OUTFILE$ = OUTDIR$ + RIGHT$(L$, LEN(L$) - 6)
OPEN OUTFILE$ FOR OUTPUT AS #2
OUTCOUNT% = OUTCOUNT% + 1
ELSEIF LEFT$(UCASE$(L$), 4) = "END " THEN
IF OUTFLAG% THEN
CLOSE #2
END IF
OUTFLAG% = FALSE
WRITEFLAG% = FALSE
ELSE
WRITEFLAG% = TRUE
END IF
IF OUTFLAG% AND WRITEFLAG% THEN
PRINT #2, L$
END IF
LOOP UNTIL (EOF(1))
PRINT OUTCOUNT%; "batch files in "; INFILE$; " written to "; OUTDIR$
SYSTEM
END